<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增HBase表数据')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-data-add">

        <div class="form-group" id="query-element">
            <ul style="list-style-type: none;">
                <li class="form-group">
                    <label class="col-sm-3 control-label is-required">筛选表名：</label>
                    <div class="col-sm-8">
                        <select id="tableName" name="tableName" class="type form-control">
                        </select>
                    </div>
                </li>

                <li>
                    <div class="form-group">
                        <label class="col-sm-3 control-label is-required">筛选列簇：</label>
                        <div class="col-sm-8">
                            <select id="familyName" name="familyName" class="router form-control">
                            </select>
                        </div>
                    </div>
                </li>

            </ul>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label is-required">字段名：</label>
            <div class="col-sm-8">
                <input name="fieldName" id="fieldName" class="form-control" type="text" required>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label is-required">row key：</label>
            <div class="col-sm-8">
                <input name="rowKey" class="form-control" type="text" required>
            </div>
        </div>

        <!--<div class="form-group">
            <label class="col-sm-3 control-label is-required">列簇名称：</label>
            <div class="col-sm-8">
                <input name="familyName" class="form-control" type="text" required>
            </div>
        </div>-->

        <!--<div class="form-group">
            <label class="col-sm-3 control-label">时间戳：</label>
            <div class="col-sm-8">
                <input name="timestamp" class="form-control" type="text">
            </div>
        </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">数据值：</label>
            <div class="col-sm-8">
                <textarea name="value" class="form-control" rows="20"></textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: jquery-cxselect-js"/>

<script th:inline="javascript">
    var data = [[${tableFamilyData}]];
    $('#query-element').cxSelect({
        selects: ['type', 'router'],
        jsonValue: 'v',
        required: true,
        data: data
    });

    var prefix = ctx + "system/data"
    $("#form-data-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $("#form-data-add").serialize());
        }
    }
</script>
</body>
</html>